//
//  ServerEntity.swift
//  vr
//
//  Created by 李旭峰 on 2020/7/20.
//

import Foundation
import UIKit

fileprivate let evn = ServerStatus.cxRelese_ipv6

class UserHostServer: Serverable {
    static func getBaseUrl(with status:ServerStatus) -> String {
        let server = UserHostServer()
        server.serverStatus = status
        return server.baseurl
    }
    var serverStatus: ServerStatus = evn
    var baseurl: String {
        var url = "http://35.201.238.6:8080/app-openapi"
        switch serverStatus {
        /// 发布服务器
        case .cxRelese_ipv6:
            url = "https://admin.asman.com.cn"// "https://2400:3200:1600::74"//
        case .cxRelese_ipv4:
            url = "https://admin.asman.com.cn"
        /// 提交测试
        case .cxTest_01:
            url = "http://test.admin.asman.com.cn"
        /// 提交测试
        case .cxTest_02:
            url = "http://test2.admin.asman.com.cn"
        /// 提交测试
        case .cxTest_03:
            url = "http://test3.admin.asman.com.cn"
            /// 自测服务器，使用mock
        case .cxMock:
            url = "http://192.168.2.140:9802"
            /// 提交测试服务器
        case .cxDevelop:
            url = "http://121.41.112.230:18081"
            /// 滴滴的本地服务器
        case .cxDiDi:
            url = "http://192.168.2.98:18080"
        case .cxHanLi:
            url = "http://192.168.2.134:18080"
        case .cxWanBiao:
            url = "http://192.168.2.108:18080"
        case .cxBingLi:
            url = "http://192.168.1.12:18080"
        }
        return url
    }
    
    var publicKey: String? {
        return nil
    }
    var privateKey: String? {
        return nil
    }
    
    var apiVersion: String? {
        return nil;
    }
}
class SmsHostServer: Serverable {
    static func getBaseUrl(with status:ServerStatus) -> String {
        let server = SmsHostServer()
        server.serverStatus = status
        return server.baseurl
    }
    var serverStatus: ServerStatus = evn
    var baseurl: String {
        var url = "http://35.201.238.6:8080/app-openapi"
        switch serverStatus {
        /// 发布服务器
        case .cxRelese_ipv6:
            url = "https://admin.asman.com.cn"// "https://2400:3200:1600::74"//
        case .cxRelese_ipv4:
            url = "https://admin.asman.com.cn"
        /// 提交测试
        case .cxTest_01:
            url = "http://47.110.252.26:18081"
        /// 提交测试
        case .cxTest_02:
            url = "http://47.110.252.26:18081"
        /// 提交测试
        case .cxTest_03:
            url = "http://47.110.252.26:18081"
            /// 自测服务器，使用mock
        case .cxMock:
            url = "http://192.168.2.140:9802"
            /// 提交测试服务器
        case .cxDevelop:
            url = "http://121.41.112.230:18081"
            /// 滴滴的本地服务器
        case .cxDiDi:
            url = "http://192.168.2.98:18080"
        case .cxHanLi:
            url = "http://192.168.2.134:18080"
        case .cxWanBiao:
            url = "http://192.168.2.108:18080"
        case .cxBingLi:
            url = "http://192.168.1.12:18080"
        }
        return url
    }
    
    var publicKey: String? {
        return nil
    }
    var privateKey: String? {
        return nil
    }
    
    var apiVersion: String? {
        return nil;
    }
}
class HostServer: Serverable {
    static func getBaseUrl(with status:ServerStatus) -> String {
        let server = HostServer()
        server.serverStatus = status
        return server.baseurl
    }
    var serverStatus: ServerStatus = evn
    var baseurl: String {
        var url = "http://35.201.238.6:8080/app-openapi"
        switch serverStatus {
        /// 发布服务器
        case .cxRelese_ipv6:
            url = "https://portalv6.asman.com.cn"// "https://2400:3200:1600::74"//
        case .cxRelese_ipv4:
            url = "https://portal.asman.com.cn"
        /// 提交测试
        case .cxTest_01:
            url = "http://test.portal.asman.com.cn"
        /// 提交测试
        case .cxTest_02:
            url = "http://test2.portal.asman.com.cn"
        /// 提交测试
        case .cxTest_03:
            url = "http://test3.portal.asman.com.cn"
            /// 自测服务器，使用mock
        case .cxMock:
            url = "http://192.168.2.140:9802"
            /// 提交测试服务器
        case .cxDevelop:
            url = "http://121.41.112.230:18080"
            /// 滴滴的本地服务器
        case .cxDiDi:
            url = "http://192.168.2.98:18080"
        case .cxHanLi:
            url = "http://192.168.2.134:18080"
        case .cxWanBiao:
            url = "http://192.168.2.108:18080"
        case .cxBingLi:
            url = "http://192.168.1.12:18080"
        }
        return url
    }
    
    var publicKey: String? {
        return nil
    }
    var privateKey: String? {
        return nil
    }
    
    var apiVersion: String? {
        return nil;
    }
}
class WebSocketServer: Serverable {
    static func getBaseUrl(with status:ServerStatus) -> String {
        let server = WebSocketServer()
        server.serverStatus = status
        return server.baseurl
    }
    var serverStatus: ServerStatus = evn
    var baseurl: String {
        var url = "http://35.201.238.6:8080/app-openapi"
        switch serverStatus {
        /// 发布服务器
        case .cxRelese_ipv6:
            url = "https://portalv6.asman.com.cn"// "https://2400:3200:1600::74"//
        case .cxRelese_ipv4:
            url = "https://portal.asman.com.cn"
        /// 提交测试
        case .cxTest_01:
            url = "http://test.portal.asman.com.cn"
        /// 提交测试
        case .cxTest_02:
            url = "http://test2.portal.asman.com.cn"
        /// 提交测试
        case .cxTest_03:
            url = "http://test3.portal.asman.com.cn"
            /// 自测服务器，使用mock
        case .cxMock:
            url = "http://192.168.2.140:9802"
            /// 提交测试服务器
        case .cxDevelop:
            url = "http://121.41.112.230:18080"
            /// 滴滴的本地服务器
        case .cxDiDi:
            url = "http://192.168.2.98:18080"
        case .cxHanLi:
            url = "http://192.168.2.134:18080"
        case .cxWanBiao:
            url = "http://192.168.2.108:18080"
        case .cxBingLi:
            url = "http://192.168.1.12:18080"
        }
        return url
    }
    
    var publicKey: String? {
        return nil
    }
    var privateKey: String? {
        return nil
    }
    
    var apiVersion: String? {
        return nil;
    }
}

